using Microsoft.Xna.Framework;

namespace CthulhuDomain.StageManagement
{
  public abstract class StageFactory
  {
    public enum eTypeStage
    {
      None = 0,
      Menu = 1,
      Level = 2,
      GameOver = 3,
      HallOfFame = 4
    }

    public static IGameServiceProvider GameServiceManager { get; set; }

    public static StageFactory GetFactory(eTypeStage type, IGameServiceProvider gameServiceProvider)
    {
      GameServiceManager = gameServiceProvider;
      StageFactory factory;
      switch (type)
      {
        case eTypeStage.Menu:
          factory = new MenuFactory(); break;
        case eTypeStage.Level:
          factory = new LevelFactory(); break;
        case eTypeStage.HallOfFame:
          factory = new HallOfFameFactory(); break;
        case eTypeStage.GameOver:
          factory = new GameOverFactory(); break;
        default: 
          factory = new MenuFactory(); break;
      }

      return factory;
    }

    public abstract Stage CreateEntity();

  }
}